home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
graphics
/
graphics3d
/
doc
/
graphics3d_e.doc
next >
Wrap
Text File
|
1999-05-25
|
57KB
|
1,840 lines
TABLE OF CONTENTS
graphics3d.library/GD_switch_rp
graphics3d.library/GD_clipbox
graphics3d.library/GD_over
graphics3d.library/GD_display3d
graphics3d.library/GD_close_display3d
graphics3d.library/GD_changeviewmode
graphics3d.library/GD_changeviewmodeobj
graphics3d.library/GD_touchpalette
graphics3d.library/GD_moveforward
graphics3d.library/GD_viewangle
graphics3d.library/GD_frustum
graphics3d.library/GD_createlightsource
graphics3d.library/GD_ambientlight
graphics3d.library/GD_positioncamera
graphics3d.library/GD_aspectratio
graphics3d.library/GD_clipmode
graphics3d.library/GD_newobj
graphics3d.library/GD_deleteobject
graphics3d.library/GD_addobjvertex
graphics3d.library/GD_addobjpoly
graphics3d.library/GD_cattpoly
graphics3d.library/GD_setobj
graphics3d.library/GD_getobj
graphics3d.library/GD_translateobject
graphics3d.library/GD_positionobject
graphics3d.library/GD_scaleobject
graphics3d.library/GD_rotateobject
graphics3d.library/GD_pickobj
graphics3d.library/GD_paintframe
graphics3d.library/GD_newview
graphics3d.library/GD_recalcobj
graphics3d.library/GD_cascene
graphics3d.library/GD_int2fix
graphics3d.library/GD_sfl2fix
graphics3d.library/GD_dfl2fix
graphics3d.library/GD_fix2int
graphics3d.library/GD_fix2sfl
graphics3d.library/GD_fix2dfl
graphics3d.library/GD_loadobject
graphics3d.library/GD_genpalette
graphics3d.library/GD_modpoly
graphics3d.library/GD_newtmap
graphics3d.library/GD_rmtmap
graphics3d.library/GD_newtmapf
graphics3d.library/GD_colldetect
graphics3d.library/GD_modobj
graphics3d.library/GD_display3d graphics3d.library/GD_display3d
NAME
GD_display3d -- To initialize all ambient for the library.
SYNOPSIS
ambient3d=GD_display3d(win, x0, y0, scrw, scrh, vdist)
A0 D0 D1 D2 D3 D4
struct ambient3d *GD_display3d(struct Window*,LONG,LONG,LONG,LONG,LONG);
FUNCTION
create and initialized the ambient3d structure that is the describer of the 3d scene and is used us input from all other functions.
INPUTS
win = pointer to Window structure of the window where you want
viewer the 3d scene.
x0,y0 = coordinates of upper left corner of the box that define
the visualizations limits of the scene.
scrw = width of this box it must be a multiply af 16 (max 3000).
It will use also as max X dimension of visualization box.
scrh = height of this box (max. 3000).
It wilL use also as max Y dimension of visualization box.
vdist = distance from observer and proiection plane ,is expressed
as integer.
RESULT
ambient3d = pointer to ambient3d structure created, if it is equal
to 0 than there is an error and the inizalization
is aborted.
BUGS
anyone note, if you find and tell me.
NOTES
This function it must be use BEFORE all the other.
It can be used more than one time on the same program than storing
separately the pointer returned, it possible to work simultaneously
and independently an all the scenes so definited.
In the future perhaps I will make possible generate more scene of
the same 3D space (for example to do more view) but all with the
same memories areas for the objects definition .Now the library ever
reallocate all areas and if the objects are much or complex it use
very more memory.
SEE ALSO
GD_close_display3d
graphics3d.library/GD_close_display3d graphics3d.library/GD_close_display3d
NAME
GD_close_display3d -- erase all over the 3d scene viewing.
SYNOPSIS
GD_close_display3d(in)
A0
void GD_close_display3d(struct ambient3d *);
FUNCTION
erase all that it was open and defined with GD_display3d included
all objects of this scene.
INPUTS
in = pointer to a ambient3d structure that you want delete.
If this pointer is 0 than it do nothing.
RESULT
BUGS
anyone note, if you find any tell me.
NOTES
use it tipically at the end of the programm to erase all that is in
relation with this library.
SEE ALSO
GD_display3d
graphics3d.library/GD_changeviewmode graphics3d.library/GD_changeviewmode
NAME
GD_changeviewmode -- change the view mode of all objects
SYNOPSIS
esi=GD_changeviewmode(in, modo, b_col)
A0 D0 D1
LONG GD_changeviewmode(struct ambient3d *,LONG,LONG);
FUNCTION
change simultaneously the view mode of ALL objects defined in the
scene3d, for now is possible only this three view modes :
wire frame, solid shading and flat shading.
INPUTS
in = pointer to ambient3d structure of the 3d scene over there
you want work.
It must be greater than 0 otherwise the result is undefined.
modo = new view mode : see GD_modobj().
b_col = color register n# to use for the border of polygon of
objects.
If it is minor than 0 than no border.
RESULT
esi = result , if different than 0 all ok, if equal to 0 than error
operation aborted.
BUGS
anyone note, if you find any tell me.
NOTES
SEE ALSO
GD_changeviewmodeobj
graphics3d.library/GD_changeviewmodeobj graphics3d.library/GD_changeviewmodeobj
OBSOLETE -- use GD_modobj() instead
NAME
GD_changeviewmodeobj -- change the view mode of selected object
SYNOPSIS
esi=GD_changeviewmodeobj(in, modo)
A0 D0
LONG GD_changeviewmodeobj(struct ambient3d *,LONG);
FUNCTION
change the view mode of the actually selected object in the 3d scene
considered.
INPUTS
in = pointer to ambient3d structure of the 3d scene over there
you want work.
It must be greater than 0 otherwise the result is undefined.
modo = new view mode :
0 -> wire frame (use macro WIREF)
1 -> flat shading (use macro FLAT)
2 -> solid shading (use macro SOLID)
3 -> goraud shading (use macro GORAUD)
RESULT
esi = result , if different than 0 all ok, if equal to 0 than error
operation aborted.
BUGS
really it wasn't tested now but I hope that it can work.
NOTES
SEE ALSO
GD_changeviewmode
graphics3d.library/GD_touchpalette graphics3d.library/GD_touchpalette
NAME
GD_touchpalette -- create a shaded color palette
SYNOPSIS
GD_touchpalette(in, fr, lr, init_color, lastcolor)
A0 D0 D1 A1 A2
void GD_touchpalette(struct ambient3d *,LONG,LONG,struct rgbtype *,struct rgbtype *);
FUNCTION
create a shaded color palette from two register color to use
corrected the flat shading view mode.
INPUTS
in = pointer to ambient3d structure of the 3d scene over
there you want work.
It must be greater than 0 otherwise the result is
undefined.
fr = first color register to set.
lr = last color register to set.
init_color = pointer to rgbtype structure with initial RGB value
of color.
lastcolor = pointer to rgbtype structure with final RGB value
of color.
RESULT
BUGS
anyone note, if you find any tell me.
NOTES
the color assegned to the object will use us reference to 'fr' for
the flat shading and it will be the darker shade , 'lr' the ligther
shade.
It must be always used because the solid shading use the central
shade us visualization color for polygons, using the object's color
us reference to 'fr'.
Now it have two range of value for RGB init_color and RGB lastcolor:
1- RGB component in the range from 0 to 15 then it can use machines
with ECS chipset and S.O < 3.0.
2- RGB component in the range from 0 to 255 than it MUST use machines
with almost AGA chipset and S.O. >= 3.0.
SEE ALSO
graphics3d.library/GD_moveforward graphics3d.library/GD_moveforward
NAME
GD_moveforward -- move the observer
SYNOPSIS
GD_moveforward(in, dist)
A0 D0
void GD_moveforward(struct ambient3d *,LONG);
FUNCTION
move the observer of dist units forward to the point of view.
INPUTS
in = pointer to ambient3d structure of the 3d scene over there
you want work.
It must be greater than 0 otherwise the result is undefined.
dist = n# of units of observer displacement ,it can be negative
(move backward) but it must be in FIX POINT that is:
integer value * 256 (or FIXV) +